<!DOCTYPE html>
<!--suppress ALL-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style th:inline="css">
    .d{
        color: [[${color}]];
    }
</style>
<body>
    <h1>test，HTML页面</h1>

<!--th:text-->
   <label th:text="${price}"></label>
    <p th:text="${str}"></p>
   <div th:text="${book.author}"></div>

<!--th:inline 内联-->
    <div class="d" th:inline="text">[[${book.price}]]</div>
<!--th:object 和 * -->
    <div th:object="${book}">
        <div th:text="*{id}"></div>
        <div th:text="*{title}"></div>
        <div th:text="*{author}"></div>
        <div th:text="*{price}"></div>
    </div>

<!--table-->
<table border="1" cellspacing="0">
    <tr>
        <td>id</td>
        <td>title</td>
        <td>author</td>
        <td>price</td>
    </tr>

    <tr th:each="b:${books}">
        <td th:text="${b.id}"></td>
        <td th:text="${b.title}"></td>
        <td th:text="${b.author}"></td>
        <td th:text="${b.price}"></td>
        <td th:if="${b.price}>40" style="color:red">太贵了</td>
        <td th:unless="${b.price}>40" style="color:red">太贵了</td>
        <td th:if="${b.price}<=40" style="color:green">推荐购买</td>

        <td th:switch="${b.price}/10">
            <label th:case="3">建议购买</label>
            <label th:case="4">价格合理</label>
            <label th:case="*">价格不合理</label>
        </td>


    </tr>
</table>
</body>
</html>
